feat: upgrade to Doctrine ORM 3.6 with ORM 3.0 compatibility fixes#395
Draft
feat: upgrade to Doctrine ORM 3.6 with ORM 3.0 compatibility fixes#395
Conversation
Co-authored-by: ambroisemaupate <380026+ambroisemaupate@users.noreply.github.com>
Co-authored-by: ambroisemaupate <380026+ambroisemaupate@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Upgrade Roadiz to Doctrine ORM 3.x
feat: upgrade to Doctrine ORM 3.6
Feb 12, 2026
ambroisemaupate
requested changes
Feb 12, 2026
Member
ambroisemaupate
left a comment
There was a problem hiding this comment.
Did you check for all 3.0 upgrade notes https://github.com/doctrine/orm/blob/3.6.x/UPGRADE.md#upgrade-to-30 ?
Most important: BC BREAK: Partial objects are removed, is it relevant for Roadiz?
- Remove deprecated HINT_FORCE_PARTIAL_LOAD from LogRepository - Remove deprecated HINT_FORCE_PARTIAL_LOAD from TagRepository - Remove deprecated HINT_FORCE_PARTIAL_LOAD from OptimizedNodesSourcesGraphPathAggregator - Add doctrine:migrations:sync-metadata-storage to upgrade steps - Update UPGRADE.md to document partial objects removal Co-authored-by: ambroisemaupate <380026+ambroisemaupate@users.noreply.github.com>
Contributor
Author
Yes, reviewed all ORM 3.0 upgrade notes. Found and fixed the critical breaking change: BC BREAK: Partial objects removed
All changes in commit 3f2dfcf. |
Copilot
AI
changed the title
feat: upgrade to Doctrine ORM 3.6
feat: upgrade to Doctrine ORM 3.6 with ORM 3.0 compatibility fixes
Feb 12, 2026
…copilot/upgrade-roadiz-to-doctrine-orm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades Doctrine ORM from 2.20 to 3.6, addressing all ORM 3.0 breaking changes including the removal of partial objects support.
Changes
Dependencies
doctrine/orm:~2.20.0→^3.6in root and 6 bundlecomposer.jsonfilesdoctrine/doctrine-bundle:^2.8.1→^2.12(not 3.x - requires PHP 8.4, Roadiz targets 8.3)Configuration
Added
metadata_cache_drivertodoctrine.yamlprod environment:Code Fixes for ORM 3.0 Compatibility
Removed deprecated
HINT_FORCE_PARTIAL_LOADquery hint (removed in ORM 3.0):lib/RoadizCoreBundle/src/Repository/LogRepository.php- scalar result querylib/RoadizCoreBundle/src/Repository/TagRepository.php- entity result with joinslib/RoadizCoreBundle/src/Routing/OptimizedNodesSourcesGraphPathAggregator.php- array result queryThis hint was used to bypass validation for partial objects, but ORM 3.0 completely removed partial objects support, making the hint obsolete.
Documentation
Added ORM 3 upgrade notes to
UPGRADE.mdcovering:doctrine:migrations:sync-metadata-storagecommandCompatibility
EntityManager::merge(), cascade merge, or partial flush usageenable_lazy_ghost_objectsalready enabledtoIterable()for batch processing (ORM 3-compatible)Note on DoctrineBundle Version
DoctrineBundle 2.12+ supports both ORM 2.x and 3.x. Version 3.x requires PHP 8.4 which conflicts with project's PHP 8.3 target.
Original prompt
This section details on the original issue you should resolve
<issue_title>Upgrade Roadiz to Doctrine ORM 3.x</issue_title>
<issue_description># 🚀 Migration Plan: Upgrade Roadiz to Doctrine ORM 3.x
Context
Roadiz currently relies on Doctrine ORM 2.x, which has reached end-of-life. Doctrine ORM 3.x introduces significant internal refactoring, removal of deprecated APIs, and ecosystem alignment (DoctrineBundle 3, DBAL 3+, etc.).
This issue tracks the full migration of Roadiz to Doctrine ORM 3.6.x (stable minor target), ensuring:
🎯 Target Stack
🧭 Migration Strategy (Phased Approach)
We will not attempt a big-bang upgrade. Migration will be done in controlled phases.
Phase 1 — Stabilize on Latest ORM 2.x (Pre-Upgrade Cleanup)
Goal
Eliminate all deprecations under ORM 2.21 before moving to 3.x.
Tasks
doctrine/orm:^2.21doctrine/dbal:^3bin/console doctrine:schema:validateWhy?
Doctrine officially recommends upgrading to the latest 2.x and clearing deprecations before jumping to 3.x.
Phase 2 — DoctrineBundle 3 Upgrade
DoctrineBundle 3 removed legacy support (annotations, YAML mapping, legacy config options).
Tasks
doctrine/doctrine-bundle:^3Doctrine\ORM\Tools\SetupusagePhase 3 — Mapping Migration (Critical)
DoctrineBundle 3 removes support for:
If Roadiz uses annotations:
They must be converted to PHP Attributes:
#[ORM\Entity]If YAML mappings exist:
They must be converted to:
Tasks
@ORM\.orm.ymlfilesdoctrine:schema:validatePhase 4 — Removed APIs & Breaking Changes (ORM 3)
This is the most critical phase.
1️⃣
EntityManager::merge()RemovedFind
Required Refactor
Replace merge usage with explicit load + patch pattern:
No automatic graph reattachment exists in ORM 3.
2️⃣ Cascade "merge" Removed
Find
Action
Remove
mergefrom cascade definitions.Allowed cascade options:
3️⃣ Flush Behavior Review
Audit usage of:
Ensure no reliance on legacy partial flush semantics.
Prefer full flush unless explicitly safe.
4️⃣ Proxy & Lazy Loading Changes
ORM 3 introduces internal improvements and optional Native Lazy Objects.
Tasks
Phase 5 — Query & Hydration Review
Audit advanced ORM usage:
ResultSetMappingiterate()toIterable()Tasks
Phase 6 — Migrations & Tooling
🔎 Repository Audit Commands
Run these before starting Phase 4:
Attach results to this issue for tracking.
🧪 Testing Requirements
Minimum validation checklist before merge:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.